package com.JinYuan;

import com.pojo.User;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author 金园
 * @create 2022/5/7
 * @Description
 * @className SpringMVCconfig
 * @packageName com.JinYuan
 */
@Controller
public class SpringMVCConfig {

    @RequestMapping("/test1")
    public String test1(){
        System.out.println("执行了");
        return "index.jsp";
    }
    @RequestMapping()
    public String aaa(){
        return "";
    }
    @RequestMapping("/ttttt")
    public String ttttt(User user){
        System.out.println("name = "+user.getName());
        System.out.println("sex = "+user.getSex());
        System.out.println("id = "+user.getId());
        System.out.println("flag = "+user.isFlag());
        return "index";
    }
    @RequestMapping(value = "/aaaaa",method = RequestMethod.GET)
    public String aaaaa(String[] arr){
        System.out.println("数组"+ Arrays.toString(arr));
        return "index";
    }
    @RequestMapping("/param02")
    public String param02(@DateTimeFormat(pattern = "yyyy-MM-dd") Date birthday){
        System.out.println("生日 = "+ birthday);
        return "index";
    }
    @RequestMapping("/param03")
    public String param03(@RequestParam("args") List<String> args){
        System.out.println("list集合 = "+ args);
        return "index";
    }
    
}
